﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Linq;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace NutriLeaf.Phone.Model
{
    [Table]
    public class Tip : INotifyPropertyChanged, INotifyPropertyChanging
    {
        private int tipID,  tipCategoryID, writtenByUserID,likeCount;
        private string tipText;
        private bool approved;

        [Column(IsPrimaryKey = true)]
        public int TipID 
        {
            get
            {
                return tipID;
            }
            set
            {
                NotifyPropertyChanging("TipID");
                tipID = value; 
                NotifyPropertyChanged("TipID");
            }

        }


        [Column]
        public string TipText
        {
            get
            {
                return tipText;
            }
            set
            {
                NotifyPropertyChanging("TipText");
                tipText = value;
                NotifyPropertyChanged("TipText");
            }

        }

        [Column]
        public int TipCategoryID
        {
            get
            {
                return tipCategoryID;
            }
            set
            {
                NotifyPropertyChanging("TipCategoryID");
                tipCategoryID = value;
                NotifyPropertyChanged("TipCategoryID");
            }

        }

        [Column]
        public int WrittenByUserID
        {
            get
            {
                return tipID;
            }
            set
            {
                NotifyPropertyChanging("WrittenByUserID");
                writtenByUserID = value;
                NotifyPropertyChanged("WrittenByUserID");
            }

        }

        [Column]
        public bool Approved
        {
            get
            {
                return approved;
            }
            set
            {
                NotifyPropertyChanging("Approved");
                approved = value;
                NotifyPropertyChanged("Approved");
            }

        }

        [Column]
        public int LikeCount
        {
            get
            {
                return likeCount;
            }
            set
            {
                NotifyPropertyChanging("LikeCount");
                likeCount = value;
                NotifyPropertyChanged("LikeCount");
            }
        }


       

        public event PropertyChangedEventHandler PropertyChanged;

        public event PropertyChangingEventHandler PropertyChanging;

        private void NotifyPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }
        private void NotifyPropertyChanging(string propertyName) { if (PropertyChanging != null) { PropertyChanging(this, new PropertyChangingEventArgs(propertyName)); } }
    }
}
